// Copyright (c) 2010, SMB SAAS Systems Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must  retain  the  above copyright notice, this
//   list of conditions and the following disclaimer.
//
// - Redistributions in binary form  must  reproduce the  above  copyright  notice,
//   this list of conditions  and  the  following  disclaimer in  the documentation
//   and/or other materials provided with the distribution.
//
// - Neither  the  name  of  the  SMB SAAS Systems Inc.  nor   the   names  of  its
//   contributors may be used to endorse or  promote  products  derived  from  this
//   software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,  BUT  NOT  LIMITED TO, THE IMPLIED
// WARRANTIES  OF  MERCHANTABILITY   AND  FITNESS  FOR  A  PARTICULAR  PURPOSE  ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL,  SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO,  PROCUREMENT  OF  SUBSTITUTE  GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)  HOWEVER  CAUSED AND ON
// ANY  THEORY  OF  LIABILITY,  WHETHER  IN  CONTRACT,  STRICT  LIABILITY,  OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE)  ARISING  IN  ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.3053
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

// 
// This source code was auto-generated by wsdl, Version=2.0.50727.42.
// 
using dotPanel.Providers.Common;
using dotPanel.Providers.HostedSolution;
using dotPanel.Providers.ResultObjects;

namespace dotPanel.Providers.CRM {
    using System.Diagnostics;
    using System.Web.Services;
    using System.ComponentModel;
    using System.Web.Services.Protocols;
    using System;
    using System.Xml.Serialization;
    
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Web.Services.WebServiceBindingAttribute(Name="CRMSoap", Namespace="http://smbsaas/dotpanel/server/")]
    [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServiceProviderItem))]
    public partial class CRM : Microsoft.Web.Services3.WebServicesClientProtocol {
        
        public ServiceProviderSettingsSoapHeader ServiceProviderSettingsSoapHeaderValue;
        
        private System.Threading.SendOrPostCallback CreateOrganizationOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetSupportedCollationNamesOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetCurrencyListOperationCompleted;
        
        private System.Threading.SendOrPostCallback DeleteOrganizationOperationCompleted;
        
        private System.Threading.SendOrPostCallback CreateCRMUserOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetOrganizationBusinessUnitsOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetAllCrmRolesOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetCrmUserRolesOperationCompleted;
        
        private System.Threading.SendOrPostCallback SetUserRolesOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetCrmUserByDomainNameOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetCrmUserByIdOperationCompleted;
        
        private System.Threading.SendOrPostCallback ChangeUserStateOperationCompleted;
        
        /// <remarks/>
        public CRM() {
            this.Url = "http://192.168.0.133:9003/CRM.asmx";
        }
        
        /// <remarks/>
        public event CreateOrganizationCompletedEventHandler CreateOrganizationCompleted;
        
        /// <remarks/>
        public event GetSupportedCollationNamesCompletedEventHandler GetSupportedCollationNamesCompleted;
        
        /// <remarks/>
        public event GetCurrencyListCompletedEventHandler GetCurrencyListCompleted;
        
        /// <remarks/>
        public event DeleteOrganizationCompletedEventHandler DeleteOrganizationCompleted;
        
        /// <remarks/>
        public event CreateCRMUserCompletedEventHandler CreateCRMUserCompleted;
        
        /// <remarks/>
        public event GetOrganizationBusinessUnitsCompletedEventHandler GetOrganizationBusinessUnitsCompleted;
        
        /// <remarks/>
        public event GetAllCrmRolesCompletedEventHandler GetAllCrmRolesCompleted;
        
        /// <remarks/>
        public event GetCrmUserRolesCompletedEventHandler GetCrmUserRolesCompleted;
        
        /// <remarks/>
        public event SetUserRolesCompletedEventHandler SetUserRolesCompleted;
        
        /// <remarks/>
        public event GetCrmUserByDomainNameCompletedEventHandler GetCrmUserByDomainNameCompleted;
        
        /// <remarks/>
        public event GetCrmUserByIdCompletedEventHandler GetCrmUserByIdCompleted;
        
        /// <remarks/>
        public event ChangeUserStateCompletedEventHandler ChangeUserStateCompleted;
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/dotpanel/server/CreateOrganization", RequestNamespace="http://smbsaas/dotpanel/server/", ResponseNamespace="http://smbsaas/dotpanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public OrganizationResult CreateOrganization(System.Guid organizationId, string organizationUniqueName, string organizationFriendlyName, string baseCurrencyCode, string baseCurrencyName, string baseCurrencySymbol, string initialUserDomainName, string initialUserFirstName, string initialUserLastName, string initialUserPrimaryEmail, string organizationCollation) {
            object[] results = this.Invoke("CreateOrganization", new object[] {
                        organizationId,
                        organizationUniqueName,
                        organizationFriendlyName,
                        baseCurrencyCode,
                        baseCurrencyName,
                        baseCurrencySymbol,
                        initialUserDomainName,
                        initialUserFirstName,
                        initialUserLastName,
                        initialUserPrimaryEmail,
                        organizationCollation});
            return ((OrganizationResult)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginCreateOrganization(System.Guid organizationId, string organizationUniqueName, string organizationFriendlyName, string baseCurrencyCode, string baseCurrencyName, string baseCurrencySymbol, string initialUserDomainName, string initialUserFirstName, string initialUserLastName, string initialUserPrimaryEmail, string organizationCollation, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("CreateOrganization", new object[] {
                        organizationId,
                        organizationUniqueName,
                        organizationFriendlyName,
                        baseCurrencyCode,
                        baseCurrencyName,
                        baseCurrencySymbol,
                        initialUserDomainName,
                        initialUserFirstName,
                        initialUserLastName,
                        initialUserPrimaryEmail,
                        organizationCollation}, callback, asyncState);
        }
        
        /// <remarks/>
        public OrganizationResult EndCreateOrganization(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((OrganizationResult)(results[0]));
        }
        
        /// <remarks/>
        public void CreateOrganizationAsync(System.Guid organizationId, string organizationUniqueName, string organizationFriendlyName, string baseCurrencyCode, string baseCurrencyName, string baseCurrencySymbol, string initialUserDomainName, string initialUserFirstName, string initialUserLastName, string initialUserPrimaryEmail, string organizationCollation) {
            this.CreateOrganizationAsync(organizationId, organizationUniqueName, organizationFriendlyName, baseCurrencyCode, baseCurrencyName, baseCurrencySymbol, initialUserDomainName, initialUserFirstName, initialUserLastName, initialUserPrimaryEmail, organizationCollation, null);
        }
        
        /// <remarks/>
        public void CreateOrganizationAsync(System.Guid organizationId, string organizationUniqueName, string organizationFriendlyName, string baseCurrencyCode, string baseCurrencyName, string baseCurrencySymbol, string initialUserDomainName, string initialUserFirstName, string initialUserLastName, string initialUserPrimaryEmail, string organizationCollation, object userState) {
            if ((this.CreateOrganizationOperationCompleted == null)) {
                this.CreateOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateOrganizationOperationCompleted);
            }
            this.InvokeAsync("CreateOrganization", new object[] {
                        organizationId,
                        organizationUniqueName,
                        organizationFriendlyName,
                        baseCurrencyCode,
                        baseCurrencyName,
                        baseCurrencySymbol,
                        initialUserDomainName,
                        initialUserFirstName,
                        initialUserLastName,
                        initialUserPrimaryEmail,
                        organizationCollation}, this.CreateOrganizationOperationCompleted, userState);
        }
        
        private void OnCreateOrganizationOperationCompleted(object arg) {
            if ((this.CreateOrganizationCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.CreateOrganizationCompleted(this, new CreateOrganizationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/dotpanel/server/GetSupportedCollationNames", RequestNamespace="http://smbsaas/dotpanel/server/", ResponseNamespace="http://smbsaas/dotpanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public string[] GetSupportedCollationNames() {
            object[] results = this.Invoke("GetSupportedCollationNames", new object[0]);
            return ((string[])(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginGetSupportedCollationNames(System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("GetSupportedCollationNames", new object[0], callback, asyncState);
        }
        
        /// <remarks/>
        public string[] EndGetSupportedCollationNames(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((string[])(results[0]));
        }
        
        /// <remarks/>
        public void GetSupportedCollationNamesAsync() {
            this.GetSupportedCollationNamesAsync(null);
        }
        
        /// <remarks/>
        public void GetSupportedCollationNamesAsync(object userState) {
            if ((this.GetSupportedCollationNamesOperationCompleted == null)) {
                this.GetSupportedCollationNamesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetSupportedCollationNamesOperationCompleted);
            }
            this.InvokeAsync("GetSupportedCollationNames", new object[0], this.GetSupportedCollationNamesOperationCompleted, userState);
        }
        
        private void OnGetSupportedCollationNamesOperationCompleted(object arg) {
            if ((this.GetSupportedCollationNamesCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetSupportedCollationNamesCompleted(this, new GetSupportedCollationNamesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/dotpanel/server/GetCurrencyList", RequestNamespace="http://smbsaas/dotpanel/server/", ResponseNamespace="http://smbsaas/dotpanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public Currency[] GetCurrencyList() {
            object[] results = this.Invoke("GetCurrencyList", new object[0]);
            return ((Currency[])(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginGetCurrencyList(System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("GetCurrencyList", new object[0], callback, asyncState);
        }
        
        /// <remarks/>
        public Currency[] EndGetCurrencyList(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((Currency[])(results[0]));
        }
        
        /// <remarks/>
        public void GetCurrencyListAsync() {
            this.GetCurrencyListAsync(null);
        }
        
        /// <remarks/>
        public void GetCurrencyListAsync(object userState) {
            if ((this.GetCurrencyListOperationCompleted == null)) {
                this.GetCurrencyListOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetCurrencyListOperationCompleted);
            }
            this.InvokeAsync("GetCurrencyList", new object[0], this.GetCurrencyListOperationCompleted, userState);
        }
        
        private void OnGetCurrencyListOperationCompleted(object arg) {
            if ((this.GetCurrencyListCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetCurrencyListCompleted(this, new GetCurrencyListCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/dotpanel/server/DeleteOrganization", RequestNamespace="http://smbsaas/dotpanel/server/", ResponseNamespace="http://smbsaas/dotpanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public ResultObject DeleteOrganization(System.Guid orgId) {
            object[] results = this.Invoke("DeleteOrganization", new object[] {
                        orgId});
            return ((ResultObject)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginDeleteOrganization(System.Guid orgId, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("DeleteOrganization", new object[] {
                        orgId}, callback, asyncState);
        }
        
        /// <remarks/>
        public ResultObject EndDeleteOrganization(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((ResultObject)(results[0]));
        }
        
        /// <remarks/>
        public void DeleteOrganizationAsync(System.Guid orgId) {
            this.DeleteOrganizationAsync(orgId, null);
        }
        
        /// <remarks/>
        public void DeleteOrganizationAsync(System.Guid orgId, object userState) {
            if ((this.DeleteOrganizationOperationCompleted == null)) {
                this.DeleteOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteOrganizationOperationCompleted);
            }
            this.InvokeAsync("DeleteOrganization", new object[] {
                        orgId}, this.DeleteOrganizationOperationCompleted, userState);
        }
        
        private void OnDeleteOrganizationOperationCompleted(object arg) {
            if ((this.DeleteOrganizationCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.DeleteOrganizationCompleted(this, new DeleteOrganizationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/dotpanel/server/CreateCRMUser", RequestNamespace="http://smbsaas/dotpanel/server/", ResponseNamespace="http://smbsaas/dotpanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public UserResult CreateCRMUser(OrganizationUser user, string orgName, System.Guid organizationId, System.Guid baseUnitId) {
            object[] results = this.Invoke("CreateCRMUser", new object[] {
                        user,
                        orgName,
                        organizationId,
                        baseUnitId});
            return ((UserResult)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginCreateCRMUser(OrganizationUser user, string orgName, System.Guid organizationId, System.Guid baseUnitId, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("CreateCRMUser", new object[] {
                        user,
                        orgName,
                        organizationId,
                        baseUnitId}, callback, asyncState);
        }
        
        /// <remarks/>
        public UserResult EndCreateCRMUser(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((UserResult)(results[0]));
        }
        
        /// <remarks/>
        public void CreateCRMUserAsync(OrganizationUser user, string orgName, System.Guid organizationId, System.Guid baseUnitId) {
            this.CreateCRMUserAsync(user, orgName, organizationId, baseUnitId, null);
        }
        
        /// <remarks/>
        public void CreateCRMUserAsync(OrganizationUser user, string orgName, System.Guid organizationId, System.Guid baseUnitId, object userState) {
            if ((this.CreateCRMUserOperationCompleted == null)) {
                this.CreateCRMUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateCRMUserOperationCompleted);
            }
            this.InvokeAsync("CreateCRMUser", new object[] {
                        user,
                        orgName,
                        organizationId,
                        baseUnitId}, this.CreateCRMUserOperationCompleted, userState);
        }
        
        private void OnCreateCRMUserOperationCompleted(object arg) {
            if ((this.CreateCRMUserCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.CreateCRMUserCompleted(this, new CreateCRMUserCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/dotpanel/server/GetOrganizationBusinessUnits", RequestNamespace="http://smbsaas/dotpanel/server/", ResponseNamespace="http://smbsaas/dotpanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public CRMBusinessUnitsResult GetOrganizationBusinessUnits(System.Guid organizationId, string orgName) {
            object[] results = this.Invoke("GetOrganizationBusinessUnits", new object[] {
                        organizationId,
                        orgName});
            return ((CRMBusinessUnitsResult)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginGetOrganizationBusinessUnits(System.Guid organizationId, string orgName, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("GetOrganizationBusinessUnits", new object[] {
                        organizationId,
                        orgName}, callback, asyncState);
        }
        
        /// <remarks/>
        public CRMBusinessUnitsResult EndGetOrganizationBusinessUnits(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((CRMBusinessUnitsResult)(results[0]));
        }
        
        /// <remarks/>
        public void GetOrganizationBusinessUnitsAsync(System.Guid organizationId, string orgName) {
            this.GetOrganizationBusinessUnitsAsync(organizationId, orgName, null);
        }
        
        /// <remarks/>
        public void GetOrganizationBusinessUnitsAsync(System.Guid organizationId, string orgName, object userState) {
            if ((this.GetOrganizationBusinessUnitsOperationCompleted == null)) {
                this.GetOrganizationBusinessUnitsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationBusinessUnitsOperationCompleted);
            }
            this.InvokeAsync("GetOrganizationBusinessUnits", new object[] {
                        organizationId,
                        orgName}, this.GetOrganizationBusinessUnitsOperationCompleted, userState);
        }
        
        private void OnGetOrganizationBusinessUnitsOperationCompleted(object arg) {
            if ((this.GetOrganizationBusinessUnitsCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetOrganizationBusinessUnitsCompleted(this, new GetOrganizationBusinessUnitsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/dotpanel/server/GetAllCrmRoles", RequestNamespace="http://smbsaas/dotpanel/server/", ResponseNamespace="http://smbsaas/dotpanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public CrmRolesResult GetAllCrmRoles(string orgName, System.Guid businessUnitId) {
            object[] results = this.Invoke("GetAllCrmRoles", new object[] {
                        orgName,
                        businessUnitId});
            return ((CrmRolesResult)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginGetAllCrmRoles(string orgName, System.Guid businessUnitId, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("GetAllCrmRoles", new object[] {
                        orgName,
                        businessUnitId}, callback, asyncState);
        }
        
        /// <remarks/>
        public CrmRolesResult EndGetAllCrmRoles(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((CrmRolesResult)(results[0]));
        }
        
        /// <remarks/>
        public void GetAllCrmRolesAsync(string orgName, System.Guid businessUnitId) {
            this.GetAllCrmRolesAsync(orgName, businessUnitId, null);
        }
        
        /// <remarks/>
        public void GetAllCrmRolesAsync(string orgName, System.Guid businessUnitId, object userState) {
            if ((this.GetAllCrmRolesOperationCompleted == null)) {
                this.GetAllCrmRolesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetAllCrmRolesOperationCompleted);
            }
            this.InvokeAsync("GetAllCrmRoles", new object[] {
                        orgName,
                        businessUnitId}, this.GetAllCrmRolesOperationCompleted, userState);
        }
        
        private void OnGetAllCrmRolesOperationCompleted(object arg) {
            if ((this.GetAllCrmRolesCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetAllCrmRolesCompleted(this, new GetAllCrmRolesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/dotpanel/server/GetCrmUserRoles", RequestNamespace="http://smbsaas/dotpanel/server/", ResponseNamespace="http://smbsaas/dotpanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public CrmRolesResult GetCrmUserRoles(string orgName, System.Guid userId) {
            object[] results = this.Invoke("GetCrmUserRoles", new object[] {
                        orgName,
                        userId});
            return ((CrmRolesResult)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginGetCrmUserRoles(string orgName, System.Guid userId, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("GetCrmUserRoles", new object[] {
                        orgName,
                        userId}, callback, asyncState);
        }
        
        /// <remarks/>
        public CrmRolesResult EndGetCrmUserRoles(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((CrmRolesResult)(results[0]));
        }
        
        /// <remarks/>
        public void GetCrmUserRolesAsync(string orgName, System.Guid userId) {
            this.GetCrmUserRolesAsync(orgName, userId, null);
        }
        
        /// <remarks/>
        public void GetCrmUserRolesAsync(string orgName, System.Guid userId, object userState) {
            if ((this.GetCrmUserRolesOperationCompleted == null)) {
                this.GetCrmUserRolesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetCrmUserRolesOperationCompleted);
            }
            this.InvokeAsync("GetCrmUserRoles", new object[] {
                        orgName,
                        userId}, this.GetCrmUserRolesOperationCompleted, userState);
        }
        
        private void OnGetCrmUserRolesOperationCompleted(object arg) {
            if ((this.GetCrmUserRolesCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetCrmUserRolesCompleted(this, new GetCrmUserRolesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/dotpanel/server/SetUserRoles", RequestNamespace="http://smbsaas/dotpanel/server/", ResponseNamespace="http://smbsaas/dotpanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public ResultObject SetUserRoles(string orgName, System.Guid userId, System.Guid[] roles) {
            object[] results = this.Invoke("SetUserRoles", new object[] {
                        orgName,
                        userId,
                        roles});
            return ((ResultObject)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginSetUserRoles(string orgName, System.Guid userId, System.Guid[] roles, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("SetUserRoles", new object[] {
                        orgName,
                        userId,
                        roles}, callback, asyncState);
        }
        
        /// <remarks/>
        public ResultObject EndSetUserRoles(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((ResultObject)(results[0]));
        }
        
        /// <remarks/>
        public void SetUserRolesAsync(string orgName, System.Guid userId, System.Guid[] roles) {
            this.SetUserRolesAsync(orgName, userId, roles, null);
        }
        
        /// <remarks/>
        public void SetUserRolesAsync(string orgName, System.Guid userId, System.Guid[] roles, object userState) {
            if ((this.SetUserRolesOperationCompleted == null)) {
                this.SetUserRolesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetUserRolesOperationCompleted);
            }
            this.InvokeAsync("SetUserRoles", new object[] {
                        orgName,
                        userId,
                        roles}, this.SetUserRolesOperationCompleted, userState);
        }
        
        private void OnSetUserRolesOperationCompleted(object arg) {
            if ((this.SetUserRolesCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.SetUserRolesCompleted(this, new SetUserRolesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/dotpanel/server/GetCrmUserByDomainName", RequestNamespace="http://smbsaas/dotpanel/server/", ResponseNamespace="http://smbsaas/dotpanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public CrmUserResult GetCrmUserByDomainName(string domainName, string orgName) {
            object[] results = this.Invoke("GetCrmUserByDomainName", new object[] {
                        domainName,
                        orgName});
            return ((CrmUserResult)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginGetCrmUserByDomainName(string domainName, string orgName, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("GetCrmUserByDomainName", new object[] {
                        domainName,
                        orgName}, callback, asyncState);
        }
        
        /// <remarks/>
        public CrmUserResult EndGetCrmUserByDomainName(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((CrmUserResult)(results[0]));
        }
        
        /// <remarks/>
        public void GetCrmUserByDomainNameAsync(string domainName, string orgName) {
            this.GetCrmUserByDomainNameAsync(domainName, orgName, null);
        }
        
        /// <remarks/>
        public void GetCrmUserByDomainNameAsync(string domainName, string orgName, object userState) {
            if ((this.GetCrmUserByDomainNameOperationCompleted == null)) {
                this.GetCrmUserByDomainNameOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetCrmUserByDomainNameOperationCompleted);
            }
            this.InvokeAsync("GetCrmUserByDomainName", new object[] {
                        domainName,
                        orgName}, this.GetCrmUserByDomainNameOperationCompleted, userState);
        }
        
        private void OnGetCrmUserByDomainNameOperationCompleted(object arg) {
            if ((this.GetCrmUserByDomainNameCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetCrmUserByDomainNameCompleted(this, new GetCrmUserByDomainNameCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/dotpanel/server/GetCrmUserById", RequestNamespace="http://smbsaas/dotpanel/server/", ResponseNamespace="http://smbsaas/dotpanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public CrmUserResult GetCrmUserById(System.Guid crmUserId, string orgName) {
            object[] results = this.Invoke("GetCrmUserById", new object[] {
                        crmUserId,
                        orgName});
            return ((CrmUserResult)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginGetCrmUserById(System.Guid crmUserId, string orgName, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("GetCrmUserById", new object[] {
                        crmUserId,
                        orgName}, callback, asyncState);
        }
        
        /// <remarks/>
        public CrmUserResult EndGetCrmUserById(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((CrmUserResult)(results[0]));
        }
        
        /// <remarks/>
        public void GetCrmUserByIdAsync(System.Guid crmUserId, string orgName) {
            this.GetCrmUserByIdAsync(crmUserId, orgName, null);
        }
        
        /// <remarks/>
        public void GetCrmUserByIdAsync(System.Guid crmUserId, string orgName, object userState) {
            if ((this.GetCrmUserByIdOperationCompleted == null)) {
                this.GetCrmUserByIdOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetCrmUserByIdOperationCompleted);
            }
            this.InvokeAsync("GetCrmUserById", new object[] {
                        crmUserId,
                        orgName}, this.GetCrmUserByIdOperationCompleted, userState);
        }
        
        private void OnGetCrmUserByIdOperationCompleted(object arg) {
            if ((this.GetCrmUserByIdCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetCrmUserByIdCompleted(this, new GetCrmUserByIdCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/dotpanel/server/ChangeUserState", RequestNamespace="http://smbsaas/dotpanel/server/", ResponseNamespace="http://smbsaas/dotpanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public ResultObject ChangeUserState(bool disable, string orgName, System.Guid crmUserId) {
            object[] results = this.Invoke("ChangeUserState", new object[] {
                        disable,
                        orgName,
                        crmUserId});
            return ((ResultObject)(results[0]));
        }
        
        /// <remarks/>
        public System.IAsyncResult BeginChangeUserState(bool disable, string orgName, System.Guid crmUserId, System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("ChangeUserState", new object[] {
                        disable,
                        orgName,
                        crmUserId}, callback, asyncState);
        }
        
        /// <remarks/>
        public ResultObject EndChangeUserState(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((ResultObject)(results[0]));
        }
        
        /// <remarks/>
        public void ChangeUserStateAsync(bool disable, string orgName, System.Guid crmUserId) {
            this.ChangeUserStateAsync(disable, orgName, crmUserId, null);
        }
        
        /// <remarks/>
        public void ChangeUserStateAsync(bool disable, string orgName, System.Guid crmUserId, object userState) {
            if ((this.ChangeUserStateOperationCompleted == null)) {
                this.ChangeUserStateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnChangeUserStateOperationCompleted);
            }
            this.InvokeAsync("ChangeUserState", new object[] {
                        disable,
                        orgName,
                        crmUserId}, this.ChangeUserStateOperationCompleted, userState);
        }
        
        private void OnChangeUserStateOperationCompleted(object arg) {
            if ((this.ChangeUserStateCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.ChangeUserStateCompleted(this, new ChangeUserStateCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        public new void CancelAsync(object userState) {
            base.CancelAsync(userState);
        }
    }
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void CreateOrganizationCompletedEventHandler(object sender, CreateOrganizationCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class CreateOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal CreateOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public OrganizationResult Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((OrganizationResult)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void GetSupportedCollationNamesCompletedEventHandler(object sender, GetSupportedCollationNamesCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetSupportedCollationNamesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetSupportedCollationNamesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public string[] Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((string[])(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void GetCurrencyListCompletedEventHandler(object sender, GetCurrencyListCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetCurrencyListCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetCurrencyListCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public Currency[] Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((Currency[])(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void DeleteOrganizationCompletedEventHandler(object sender, DeleteOrganizationCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class DeleteOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal DeleteOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public ResultObject Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((ResultObject)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void CreateCRMUserCompletedEventHandler(object sender, CreateCRMUserCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class CreateCRMUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal CreateCRMUserCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public UserResult Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((UserResult)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void GetOrganizationBusinessUnitsCompletedEventHandler(object sender, GetOrganizationBusinessUnitsCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetOrganizationBusinessUnitsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetOrganizationBusinessUnitsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public CRMBusinessUnitsResult Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((CRMBusinessUnitsResult)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void GetAllCrmRolesCompletedEventHandler(object sender, GetAllCrmRolesCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetAllCrmRolesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetAllCrmRolesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public CrmRolesResult Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((CrmRolesResult)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void GetCrmUserRolesCompletedEventHandler(object sender, GetCrmUserRolesCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetCrmUserRolesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetCrmUserRolesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public CrmRolesResult Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((CrmRolesResult)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void SetUserRolesCompletedEventHandler(object sender, SetUserRolesCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class SetUserRolesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal SetUserRolesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public ResultObject Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((ResultObject)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void GetCrmUserByDomainNameCompletedEventHandler(object sender, GetCrmUserByDomainNameCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetCrmUserByDomainNameCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetCrmUserByDomainNameCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public CrmUserResult Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((CrmUserResult)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void GetCrmUserByIdCompletedEventHandler(object sender, GetCrmUserByIdCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetCrmUserByIdCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetCrmUserByIdCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public CrmUserResult Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((CrmUserResult)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void ChangeUserStateCompletedEventHandler(object sender, ChangeUserStateCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class ChangeUserStateCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal ChangeUserStateCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public ResultObject Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((ResultObject)(this.results[0]));
            }
        }
    }
}
